import request from '@/utils/request'

export const getimg = () => {
  return request.get('/captcha/image')
}

export const getcode = (imgcode, imgkey, phone) => {
  return request({
    url: '/captcha/sendSmsCaptcha',
    method: 'post',
    data: {
      form: {
        captchaCode: imgcode,
        captchaKey: imgkey,
        mobile: phone
      }
    }
  })
}

export const phonelogin = (isParty, mobile, partyData, smsCode) => {
  return request({
    url: '/passport/login',
    method: 'post',
    data: {
      form: {
        smsCode: smsCode,
        mobile: mobile,
        isParty: isParty,
        partyData: {}
      }
    }
  })
}
